function mergeList(l1, l2) {
    if (l1 == null) return l2;
    if (l2 == null) return l1;
    if (l1.val <= l2.val) {
        l1.next = mergeList(l1.next, l2);
        return l1;
    } else {
        l2.next = mergeList(l2.next, l1);
        return l2;
    }
}

function mergeList(l1, l2) {
    if (l1 == null) return l2;
    if (l2 == null) return l1;
    let dummy = new ListNode(-1);
    let cur = dummy;
    while (l1 != null && l2 != null) {
        if (l1.val <= l2.val) {
            cur.next = l1;
            l1 = l1.next;
        } else {
            cur.next = l2;
            l2 = l2.next;
        }
        cur = cur.next;
    }
    cur.next = l1 == null ? l2 : l1;
    return dummy.next;
}

function mergeNumber(nums1, m, nums2, n) {
    let res = nums1.splice(m, nums1.length - m, ...nums2);
    console.log(res);
    res.sort((a, b) => a - b);
    return res;

}
let res = mergeNumber([1, 2, 3, 0, 0, 0], [2, 5, 6])
console.log(res);
